package com.sc.token;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * token配置类，包含的属性有 加密密钥和到期时间(都有默认值)
 */

@AllArgsConstructor
@Data
@Component
public class TokenProperties {
    private String privateKey = "defaultPrivateKey"; // 默认值
    private long expireTime = 10 * 60 * 1000; // 默认10分钟
    private List<String> excludePatterns = new ArrayList<>();   //放行路径

    public TokenProperties(){
        excludePatterns.add("/login");
        excludePatterns.add("/register");
    }
}
